@import '../../styles/theme.scss';

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  min-width: 200px;
  animation: slideUp 0.4s ease-out;
}

.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-lg);
}

// 现代化旋转器
.spinnerContainer {
  position: relative;
  width: 80px;
  height: 80px;
}

.modernSpinner {
  position: relative;
  width: 100%;
  height: 100%;
}

.spinnerRing {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 3px solid transparent;
  border-radius: 50%;
  animation: modernSpin 2s linear infinite;
  
  &:nth-child(1) {
    border-top-color: #667eea;
    animation-delay: 0s;
    animation-duration: 1.5s;
  }
  
  &:nth-child(2) {
    border-right-color: #764ba2;
    animation-delay: -0.5s;
    animation-duration: 2s;
    width: 70%;
    height: 70%;
    top: 15%;
    left: 15%;
  }
  
  &:nth-child(3) {
    border-bottom-color: #f093fb;
    animation-delay: -1s;
    animation-duration: 2.5s;
    width: 40%;
    height: 40%;
    top: 30%;
    left: 30%;
  }
}

// 进度环容器
.progressContainer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progressRing {
  :global(.ant-progress-circle) {
    filter: drop-shadow(0 4px 8px rgba(102, 126, 234, 0.3));
  }
  
  :global(.ant-progress-circle-path) {
    transition: stroke-dasharray 0.3s ease;
  }
}

// 点状加载器
.dotsContainer {
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(45deg, #667eea, #764ba2);
  animation: dotBounce 1.4s ease-in-out infinite both;
  
  &:nth-child(1) {
    animation-delay: -0.32s;
  }
  
  &:nth-child(2) {
    animation-delay: -0.16s;
  }
  
  &:nth-child(3) {
    animation-delay: 0s;
  }
}

// 加载文本
.loadingText {
  font-size: var(--font-size-lg);
  color: var(--text-primary);
  font-weight: 500;
  text-align: center;
  margin: 0;
}

// 进度条
.progressBar {
  width: 200px;
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progressFill {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
  position: relative;
  
  &::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 1.5s infinite;
  }
}

// 动画定义
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modernSpin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes dotBounce {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1.2);
    opacity: 1;
  }
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

// 响应式设计
@media (max-width: 768px) {
  .container {
    margin: var(--spacing-lg);
    padding: var(--spacing-lg);
    min-width: auto;
    width: calc(100% - var(--spacing-xl) * 2);
  }
  
  .loadingText {
    font-size: var(--font-size-md);
  }
  
  .progressBar {
    width: 150px;
  }
}